<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>修改值</title>
</head>
<body>
    <span id="s1">hello world</span>
    <script>
        //将helloworld修改为好好学习
        let s = document.getElementById('s1').innerText='好好学习'



    </script>
    <hr>
    <span id="s2">hello world</span>
    <script>
        //将hello中world使用b标签加粗
        let s2 = document.getElementById('s2').innerText='hello <b>world</b>'
       
    </script>
    <a href="#" class="c1">网站名</a>
    <script>
        //将href改为http://www.naidu.com

a.innerText='baidu'
var a = document.getElementsByTagName('a')[0];
a.setAttribute('href','http://www.naidu.com')
a.target='_blank';
</script>
<div>
    this is box
</div>
<script>
    var div=document.querySelector('div')
    div.style.width='200px';
    div.style.height='200px';
    div.style.border='1px red soild';
    div.style.textAlign='center';
    div.style.color='blue';
</script>
</body>
</html>